Imports System.Data

Public Class clsFunciones
    Public Shared Function RevisaErrores(ByVal DsError As DataSet) As Boolean
        Dim CodError As String
        Dim table As System.Data.DataTable
        Dim tablename As String
        Dim i As Integer
        Dim n As Long
        Dim bolRespuesta As Boolean = True

        If DsError Is Nothing Then Return True

        With DsError
            For i = 0 To .Tables.Count() - 1
                table = .Tables(i)
                tablename = LCase(table.TableName)
                n = table.Rows.Count
                If n > 0 Then
                    With table.Rows(0)
                        Try
                            CodError = .Item("cod_error")
                            bolRespuesta = False
                        Catch objException As Exception
                        End Try
                    End With
                End If
            Next
        End With
        Return bolRespuesta
    End Function
End Class

